package com.app;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.app.bean.NoticeBean;
import com.bumptech.glide.Glide;

public class NoticeDetail extends AppCompatActivity {

    private TextView name, content, time;
    private ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notice_detail);
        initView();

        NoticeBean bean = (NoticeBean) getIntent().getSerializableExtra("bean");

        name.setText(bean.getName());
        content.setText(bean.getContent());
        time.setText(bean.getTime());
//        imageView.setImageResource(bean.getImage());
        Glide.with(this).load(bean.getPic()).into(imageView);
    }

    private void initView() {
        Toolbar toolbar = findViewById(R.id.toolbar);
        toolbar.getChildAt(0).setOnClickListener(v -> finish());
        ((TextView) toolbar.getChildAt(1)).setText("通知详细");

        name = findViewById(R.id.name);
        content = findViewById(R.id.content);
        time = findViewById(R.id.time);
        imageView=findViewById(R.id.detail_image);
    }
}